get:
  summary: Retrieve a Files
  description: Retrieve a single file by unique identifier.
  tags:
    - Files
  operationId: getFile
  parameters:
    - $ref: '../../openapi.yaml#/components/parameters/Fields'
    - $ref: '../../openapi.yaml#/components/parameters/Meta'
  responses:
    '200':
      description: Successful request
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '../../openapi.yaml#/components/schemas/Files'
    '401':
      $ref: '../../openapi.yaml#/components/responses/UnauthorizedError'

patch:
  summary: Update a File
  description: Update an existing file, and/or replace it's file contents.
  tags:
    - Files
  operationId: updateFile
  parameters:
    - $ref: '../../openapi.yaml#/components/parameters/Fields'
    - $ref: '../../openapi.yaml#/components/parameters/Meta'
  requestBody:
    content:
      multipart/data:
        schema:
          type: object
          required:
            - file
          properties:
            title:
              description: Title for the file. Is extracted from the filename on upload, but can be edited by the user.
              example: User Avatar
              type: string
            filename_download:
              description: Preferred filename when file is downloaded.
              type: string
            description:
              description: Description for the file.
              type: string
              nullable: true
            folder:
              description: Virtual folder where this file resides in.
              example: null
              oneOf:
                - type: string
                - $ref: '../../openapi.yaml#/components/schemas/Folders'
              nullable: true
            tags:
              description: Tags for the file. Is automatically populated based on Exif data for images.
              type: array
              nullable: true
              items:
                type: string
            file:
              description: File contents.
              format: binary
      application/json:
        schema:
          type: object
          properties:
            title:
              description: Title for the file. Is extracted from the filename on upload, but can be edited by the user.
              example: User Avatar
              type: string
            filename_download:
              description: Preferred filename when file is downloaded.
              type: string
            description:
              description: Description for the file.
              type: string
              nullable: true
            folder:
              description: Virtual folder where this file resides in.
              example: null
              oneOf:
                - type: string
                - $ref: '../../openapi.yaml#/components/schemas/Folders'
              nullable: true
            tags:
              description: Tags for the file. Is automatically populated based on Exif data for images.
              type: array
              nullable: true
              items:
                type: string
  responses:
    '200':
      description: Successful request
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '../../openapi.yaml#/components/schemas/Files'
    '401':
      $ref: '../../openapi.yaml#/components/responses/UnauthorizedError'

delete:
  summary: Delete a File
  description: Delete an existing file.
  tags:
    - Files
  operationId: deleteFile
  responses:
    '200':
      description: Successful request
    '401':
      $ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
parameters:
  - $ref: '../../openapi.yaml#/components/parameters/UUId'
